<div class="filter clearfix basis-module">
	<div class="page-header">
		<ol class="breadcrumb">
			<li><a href="#/welcome"><h1><i class="icon icon-home"></i>{{$root.i18n.public.home}}<h1></a></li>
			<li>{{$root.global.menu.nowMenu.parent.name}}</li>
			<li><a href="#{{$root.global.menu.nowMenu.url}}">{{$root.global.menu.nowMenu.name}}</a></li>
		</ol>
	</div>

	<div class="page-body">
		<form class="form-horizontal">
			<div class="form-group col-sm-3">
				<label class="control-label col-sm-4">{{$root.i18n.user.userId}}:</label>
				<div class="col-sm-8">
					<input type="text" ng-model="entity.userId" class="form-control" placeholder="{{$root.i18n.public.likeQuery}}">
				</div>
			</div>
			<div class="form-group col-sm-3">
				<label class="control-label col-sm-4">{{$root.i18n.user.userName}}:</label>
				<div class="col-sm-8">
					<input type="text" ng-model="entity.userName" class="form-control" placeholder="{{$root.i18n.public.likeQuery}}">
				</div>
			</div>
			<div class="form-group col-sm-3">
				<label class="control-label col-sm-4">{{$root.i18n.user.userMobile}}:</label>
				<div class="col-sm-8">
					<input type="text" ng-model="entity.userMobile" class="form-control" placeholder="{{$root.i18n.public.likeQuery}}">
				</div>
			</div>
			<div class="form-group col-sm-3">
				<label class="control-label col-sm-4">{{$root.i18n.public.status}}:</label>
				<div class="col-sm-8">
					<select class="form-control" ng-model="entity.status">
						<option value="">&nbsp;</option>
						<option value="0">{{$root.i18n.user.statusNormal}}</option>
						<option value="1">{{$root.i18n.user.statusFrozen}}</option>
					</select>
				</div>
			</div>
			<div class="form-group col-sm-12">
				<div class="col-sm-2 pull-right">
					<button type="submit" class="btn btn-primary form-control col-sm-3" ng-click="query()" ng-disabled="entity.querying"><i class="icon icon-search"></i>{{$root.i18n.public.query}}</button>
				</div>
				<div class="col-sm-2 pull-right">
					<button type="submit" class="btn btn-primary form-control col-sm-3" ng-click="create()" ng-disabled="entity.querying"><i class="icon icon-plus"></i>{{$root.i18n.public.create}}</button>
				</div>
			</div>

		</form>
		<br />
		<table class="table table-striped">
			<header>
				<th>#</th>
				<th>{{$root.i18n.user.userId}}</th>
				<th>{{$root.i18n.user.userPortrait}}</th>
				<th>{{$root.i18n.user.userName}}</th>
				<th>{{$root.i18n.user.nickName}}</th>
				<th>{{$root.i18n.user.userMobile}}</th>
				<th>{{$root.i18n.public.status}}</th>
				<th>{{$root.i18n.public.createName}}</th>
				<th>{{$root.i18n.public.createAt}}</th>
				<th>{{$root.i18n.public.option}}</th>
			</header>
			<tbody>
				<tr ng-if="!result.userList  && page.totalCount !== 0">
					<td class="loading-holder" colspan="40">
						<div class="text-center">
							<span ><i class="icon icon-spinner icon-spin"></i></span>
						</div>
					</td>
				</tr>
				<tr ng-if="result.userList && page.totalCount === 0">
					<td colspan="40">
						<div class="text-center">{{$root.i18n.public.noData}}</div>
					</td>
				</tr>
			</tbody>
			<tbody>
				<tr ng-repeat="user in result.userList">
					<td>{{$index + 1 + (page.pageNo - 1) * page.pageSize}}</td>
					<td>{{user.userId}}</td>
					<td><img-uploader ng-if="user.imgUrl" src="user.imgUrl" width="70px" height="auto" disabled="true"></img-uploader></td> 
					<td>{{user.userName}}</td> 
					<td>{{user.nickName}}</td>
					<td>{{user.userMobile}}</td>
					<td>{{user.status | userStatusFilter}}</td> 
					<td>{{user.createName}}</td> 
					<td>{{user.createAt | date:'yyyy-MM-dd HH:mm:ss'}}</td>
					<td>
						<a href="#/user/userDetail/{{user.id}}"> {{$root.i18n.public.detail}}</a>

						<span ng-if="user.status == 0">
							<i class="text-divider">|</i>
							<a href="javascript:;" ng-click="changeStatus(user,1)"> {{$root.i18n.user.statusOptNormal}}</a>
						</span>
						<span ng-if="user.status == 1">
							<i class="text-divider" >|</i>
							<a href="javascript:;" ng-click="changeStatus(user,0)"> {{$root.i18n.user.statusOptFrozen}}</a>
							<i class="text-divider">|</i>
							<a href="javascript:;" ng-click="update(user)"> {{$root.i18n.public.update}}</a>
						</span>
						<i class="text-divider">|</i>
						<a href="javascript:;" ng-click="authority(user)"> {{$root.i18n.user.authority}}</a>
					</td> 
				</tr>
			</tbody>
		</table>
	</div>
	<div class="page-footer">
		<uib-pagination total-items="page.totalCount" ng-model="page.pageNo" items-per-page="page.pageSize" ng-change="query()"  max-size="5" class="pagination-sm pull-right"></uib-pagination>
	</div>
</div>